package polymorphicTest;

public class Test {
    public static void main(String[] args) {
        Animal dog1=new Dog(10,10);
        Animal cat1=new Cat(10,10);
        dog1.eat("bone");
        cat1.eat("fish");
        System.out.println(dog1.getTi_li()+" "+dog1.getQin_mi_du());
        System.out.println(cat1.getTi_li()+" "+cat1.getQin_mi_du());
        dog1.play();
        cat1.play();
        System.out.println(dog1.getTi_li()+" "+dog1.getQin_mi_du());
        System.out.println(cat1.getTi_li()+" "+cat1.getQin_mi_du());
        dog1.eat("fish");
        cat1.eat("bone");
        System.out.println(dog1.getTi_li()+" "+dog1.getQin_mi_du());
        System.out.println(cat1.getTi_li()+" "+cat1.getQin_mi_du());
    }
}
